#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableRaidRunMapDao:DaoBase<TableRaidRunMap>
    {
        public override string GetFileName()
        {
            return "TableRaidRunMap.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableRaidRunMap>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableRaidRunMap model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.runMapId)) UnityEngine.Debug.LogError("数据表id重复:TableRaidRunMap->id: " + model.runMapId);
            #endif
            cachePrimaryInt[model.runMapId] = model;
        }
        protected override TableRaidRunMap ParseRowData(string[] rowData)
        {
            TableRaidRunMap data = new TableRaidRunMap();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.runMapId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.autoEnterFight = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.dropShowItems = string.Intern(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.recommendLevel = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.desc = rowData[4];
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.image = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.sceneEventConfig = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.sceneMapId = int.Parse(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.beginConditionGroupId = int.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.beginCOndtionDesc = rowData[9];
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.strongBoss = int.Parse(rowData[10]);
            }
            return data;
        }
    }
}
